package cn.javacc.nav.service;

import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.javacc.nav.dao.LinkTrackingDao;
import cn.javacc.nav.domain.LinkTracking;

@Service
public class LinkTrackingService {
	@Inject
	private LinkTrackingDao linkTrackingDao;

	public LinkTracking getLinkTrackingById(Long id) {
		return this.linkTrackingDao.get(id);
	}

	public List<LinkTracking> listLinkTrackings(int offset, int fetchSize) {
		return this.linkTrackingDao.findAll(offset, fetchSize);
	}

	public int getLinkTrackingTotalSize() {
		return this.linkTrackingDao.getTotalSize();
	}

	@Transactional
	public void saveLinkTracking(LinkTracking linkTracking) {
		this.linkTrackingDao.save(linkTracking);
	}

	@Transactional
	public void updateLinkTracking(LinkTracking linkTracking) {
		this.linkTrackingDao.update(linkTracking);
	}

	@Transactional
	public void deleteLinkTracking(Long id) {
		this.linkTrackingDao.delete(id);
	}
}
